<%--
  Created by IntelliJ IDEA.
  User: SamZhao
  Date: 2016/12/5
  Time: 13:54
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include.inc.jsp"%>
<script>$(document).ready(function(c) {
    $('.close').on('click', function(c){
        $('.login-form').fadeOut('slow', function(c){
            $('.login-form').remove();
        });
    });
});
</script>
<!--SIGN UP-->
<h1>BMS4.0 登录</h1>
<div class="login-form">
    <div class="close"> </div>
    <div class="head-info">
        <label class="lbl-1"> </label>
        <label class="lbl-2"> </label>
        <label class="lbl-3"> </label>
    </div>
    <div class="clear"> </div>
    <div class="avtar">
        <img src="/images/avtar.png" />
    </div>
    <form>
        <input type="text" class="text" value="admin" id="loginname" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'admin';}" >
        <div class="key">
            <input type="password" id="loginpassword" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '';}">
        </div>
    </form>
    <div class="signin">
        <input type="submit" value="Login" onclick="submitForm();">
    </div>
</div>
<div class="copy-rights">
    <p>Copyright &copy; 2016.Company name All rights reserved.More Templates <a href="" target="_blank" title="SamZhao">SamZhao</a> - Collect from <a href="" title="BMS4.0" target="_blank">BMS4.0</a></p>
</div>

<script type="text/javascript">
    function submitForm(){
        $.ajax({
            url:"/login/loginCheck.html",
            type:"post",
            data:{username:$("#loginname").val(),userpassword:$("#loginpassword").val()},
            success:function(data){
                if(data == '1'){
                    alert("用户名密码错误！！");
                    window.location = "/login/index.html";
                } else{
                    window.location = "/home/index.html";
                }

            },
            error:function(e){
                alert("错误！！");
            }
        });
    }
</script>